﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LamdaTest5
{
    class Program
    {
        delegate int ConverterMethod(int i);
        static void Main(string[] args)
        {
            ConverterMethod converter1 = (x) => x * x;
            ConverterMethod converter2 = (x) => { return x + x; };
            Func<string, string, int> func = (s1, s2) => s1.Length + s2.Length;
            Func<int, int> func2 = x => x + 5;
            Console.WriteLine(converter1(5));


            int factor = 2;
            Func<int, int> multiplier = n => n * factor;

            Func<string, string> func3 = delegate (string str)
            {
                return str + " ,";
            };

            Console.WriteLine(multiplier(2));

            Console.Read();
        }
    }
}